import request from '@/utils/request.js'

/**
 * 维修日报
 */

// 维修项目 下拉
export const dailyProjectConfigListApi = (params) => request({ url: `/web/dailyProjectConfig/list`, method: 'get', params, loading: true })

// 查询维修日报列表
export const getListApi = (params, data) => request({ url: `/web/maintenanceDaily/list`, method: 'get', params, data, loading: true })

// 根据当前用户企业获取船舶列表
export const getShippingListApi = (params) => request({ url: `/web/shipping/listAllByOneselfEnterpriseId`, method: 'get', params })

// 船队经理
export const getCustomerListApi = (params) => request({ url: `/web/customer/listAllByOneselfEnterpriseId`, method: 'get', params })

// 新增维修日报
export const dailyAddApi = (data) => request({ url: `/web/maintenanceDaily`, method: 'post', data, loading: true })

// 修改维修日报
export const dailyEditApi = (data) => request({ url: `/web/maintenanceDaily`, method: 'PUT', data, loading: true })

// 维修日报 详情
export const dailyDetailApi = (id) => request({ url: `/web/maintenanceDaily/${id}`, method: 'get', loading: true })

// 获取最新的维修日报详细信息
export const getNewMaintenanceDailyApi = () => request({ url: `/web/maintenanceDaily/getNewMaintenanceDaily`, method: 'get', loading: true })

// 获取日报时间轴
export const getTimeAxisApi = (params) => request({ url: `/web/maintenanceDaily/getTimeAxis`, method: 'get', params })

// 查询坞修中标修船厂
export const listDockRepairWinningTheBidApi = (data) => request({ url: `/web/enterprise/listDockRepairWinningTheBid`, method: 'post', data })

// 导出日报
export const exportDailyApi = (params) => request({ url: `/web/maintenanceDaily/exportDaily`, method: 'post', params, loading: true, responseType: 'blob' })

// 接受中标后的校验
export const validFinishOrderApi = (params) => request({ url: `/web/finishOrder/validFinishOrder`, method: 'get', params })
